<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Ppe
 *
 * @property int $id
 * @property string $unify_number 统一编号
 * @property string $name 设备名称
 * @property string $norms 型号规格
 * @property string $factory_number 出厂编号
 * @property int $factory_at 出厂时间
 * @property float $cost 原值
 * @property int $buy_at 购买时间
 * @property string $manufactures 生产厂家
 * @property string $status 状态
 * @property string $manage_depart 管理部门
 * @property string $save_in 保存位置
 * @property string $user_depart 使用部门
 * @property string $person 使用人
 * @property int $used_at 使用日期
 * @property int $use_num 使用次数
 * @property int $verify_period 检测周期
 * @property int $depreciate_year 折旧年限
 * @property int $verify_at 检定日期
 * @property int $next_verify_at 下次检定日期
 * @property string $unit 检定单位
 * @property string $ins_require 检定要求
 * @property string $result 检定结果
 * @property string $conclusion 结论
 * @property string $verify_person 检定人
 * @property int $upkeep_period 保养周期
 * @property int $next_upkeep_at 下次保养日期
 * @property int $inspect_period 核查周期
 * @property string $remarks 备注
 * @property int $file_at 归档日期
 * @property int $company_id 企业id
 * @property int $depart_id 部门id
 * @property \Carbon\Carbon $created_at 创建时间戳
 * @property \Carbon\Carbon $updated_at 修改时间戳
 * @property-read \App\Company $company
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereBuyAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereCompanyId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereConclusion($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereCost($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereDepartId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereDepreciateYear($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereFactoryAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereFactoryNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereFileAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereInsRequire($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereInspectPeriod($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereManageDepart($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereManufactures($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereNextUpkeepAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereNextVerifyAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereNorms($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe wherePerson($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereRemarks($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereResult($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereSaveIn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereUnifyNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereUnit($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereUpkeepPeriod($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereUseNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereUsedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereUserDepart($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereVerifyAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereVerifyPeriod($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Ppe whereVerifyPerson($value)
 * @mixin \Eloquent
 */
class Ppe extends Model
{
    protected $guarded = [];

    /**
     * @param \DateTime|int $value
     * @return false|int
     * @author dividez
     */
    public function fromDateTime($value)
    {
        return strtotime(parent::fromDateTime($value));
    }

    public function company()
    {
        return $this->belongsTo(Company::class);
    }

}
